import React, { Component } from 'react'
import  './footer.scss'
import {connect} from 'react-redux'
import { updateAction } from '../../store/actionCreator';
class Footer extends Component {
  render() {
    return (
      <div className='footer'>
        Copyright © 2014 todolist.cn <span onClick={()=>{this.props.clearToDoList()}}>clear</span>
      </div>
    )
  }
}
const mapStareToProps=(state)=>{
  return {
    ToDoList:state.ToDoList
}}
const mapDispatchToProps=(dispatch)=>{
  return{
    clearToDoList:()=>{
      dispatch(updateAction([]))
    }
  }
}
export default connect(mapStareToProps,mapDispatchToProps)(Footer)